//分页
const getTeacherPage = (params) => {
    return $axios({
        url: '/teacher/page',
        method: 'get',
        params
    })
}


//删除老师
// function deleteTeacher (teacherId) {
//     return $axios({
//         url: `/teacher/${teacherId}`,
//         method: 'delete',
//
//     })
// }

//新增老师
const addTeacher = (params) => {
    return $axios({
        url: '/teacher',
        method: 'post',
        data: {...params}
    })
}

//状态修改
function enableOrDisableStatus(params) {
    return $axios({
        url: '/teacher/changeStatus',
        method: 'put',
        data: {...params}
    })
}

// 删除接口
const deleteTeacher = (userId) => {
    return $axios({
        url: `/teacher/${userId}`,
        method: 'delete',
        params: {userId}
    })
}

// 查询详情
const queryTeacherById = (userId) => {
    return $axios({
        url: `/teacher/${userId}`,
        method: 'get'
    })
}

// 修改接口
const editTeacher = (params) => {
    return $axios({
        url: '/teacher/edit',
        method: 'put',
        data: {...params}
    })
}

//通过teacherId查看老师的所有课程
const getByIdWithClasses = (userId) => {
    return $axios({
        url: `/teacher/classes/${userId}`,
        method: 'get'
    })
}

function getAllShopkeeperName() {
    return $axios({
        url: '/shopkeeper/list',
        method: 'get'
    })
}
